package com.example.user.v1;

import com.example.model.acl.dtos.AclLoginDto;
import com.example.model.common.dtos.ResponseResult;
import com.example.user.service.AclUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/backend/v1/login")
@Api(value = "后台用户登录",tags = "后台用户登录")
public class AclUserLoginController {

    @Autowired
    AclUserService aclUserService;

    @PostMapping("/login_auth")
    @ApiOperation("用户登录")
    public ResponseResult login(@RequestBody AclLoginDto aclLoginDto){
        return aclUserService.login(aclLoginDto);
    }

    @GetMapping("/logout")
    @ApiOperation("退出登录")
    public ResponseResult logout(){
        return aclUserService.logout();
    }
}
